class Project < ActiveRecord::Base
    NAME_ERROR = 'You must specify a valid project name.'
    KEY_ERROR = 'You must specify a unique project key, at least 2 characters long, containing only uppercase letters.'
    validates_presence_of :name, :message => NAME_ERROR
    validates_presence_of :key, :message => KEY_ERROR
    validates_uniqueness_of :key, :message => KEY_ERROR
    validates_format_of :key, :with => /[A-Z]{2,}/, :message => KEY_ERROR
end
